package edu.zut.operator;

import java.util.Scanner;

public class OperatorDemo3 {

    public static void main(String[] args) {
        //计算两个数字之和  差  乘  取商  取余
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入两个整数");
        int i = scanner.nextInt();
        int j = scanner.nextInt();
        int sum = i + j;
        System.out.println("sum = " + sum);
        int dif = i - j;
        System.out.println("dif = " + dif);
        int mul = i * j;
        System.out.println("mul = " + mul);
        int rem = i % j;
        System.out.println("rem = " + rem);
        int quo = i / j;   //整数是取商  但是如果是浮点型
        System.out.println("quo = " + quo);
        double d = 45.5;
        //只要有一个是小数，就按照数学运算
        double z = i / d;
        System.out.println("z = " + z);
        //算术赋值运算符   +=   -=   *=   /=   %=
        i += 2;  // i = i + 2
        i -= 3;  // i = i - 3
        i *= 3;  // i = i * 3
        //......




    }
}
